# Copyright (c) 2017 by Michael Zahniser
# Copyright (c) 2018 by Nate Graham
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

mission "Frontier delivery [0]"
	name "辺境の<planet>への配達"
	job
	repeat
	description "<cargo>を辺境の世界である<destination>に配達せよ。辺境星系は海賊行為が高い割合でおきているので、自分の身を守る用意をすること。報酬は <payment>。"
	cargo random 5 2 .1
	to offer
		random < 30
	source
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	destination
		not government "Pirate"
		distance 2 10
		attributes "frontier"
	npc
		government "Pirate"
		personality nemesis harvests plunders
			confusion 30
		system destination
		fleet "Small Northern Pirates"
	npc
		government "Pirate"
		personality nemesis staying harvests plunders
			confusion 30
		system destination
		fleet "Small Northern Pirates" 2
	on complete
		payment 4000 180
		dialog phrase "generic cargo delivery payment"


mission "Frontier delivery [1]"
	name "辺境の<planet>への配達"
	job
	repeat
	description "<cargo>を辺境の世界である<destination>に配達せよ。辺境星系は海賊行為が高い割合でおきているので、自分の身を守る用意をすること。報酬は <payment>。"
	cargo random 25 2 .05
	to offer
		random < 25
	source
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	destination
		not government "Pirate"
		distance 2 10
		attributes "frontier"
	npc
		government "Pirate"
		personality nemesis harvests plunders
			confusion 20
		system destination
		fleet "Small Northern Pirates" 2
	npc
		government "Pirate"
		personality nemesis staying harvests plunders
			confusion 20
		system destination
		fleet "Small Northern Pirates" 3
	on complete
		payment 4000 180
		dialog phrase "generic cargo delivery payment"


mission "Frontier delivery [2]"
	name "辺境の<planet>への配達"
	job
	repeat
	description "<cargo>を辺境の世界である<destination>に配達せよ。辺境星系は海賊行為が高い割合でおきているので、自分の身を守る用意をすること。報酬は <payment>。"
	cargo random 40 2 .02
	to offer
		random < 20
	source
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	destination
		not government "Pirate"
		distance 2 10
		attributes "frontier"
	npc
		government "Pirate"
		personality nemesis harvests plunders
		system destination
		fleet "Large Northern Pirates"
	npc
		government "Pirate"
		personality nemesis staying harvests plunders
		system destination
		fleet "Small Northern Pirates"
		fleet "Large Northern Pirates"
	on complete
		payment 4000 180
		dialog phrase "generic cargo delivery payment"


mission "Frontier Emigration [0]"
	name "移民を<planet>へ"
	job
	repeat
	description "この <bunks> 人の乗客は、ついに<destination>で新しい人生を始められるだけのお金をためた。そして輸送してもらうためには <payment>支払ってもかまわないと思っている。"
	passengers 2 10 .9
	to offer
		random < 30
	source
		not government "Pirate"
		attributes "frontier"
		not planet "Shangri-La"
	destination
		distance 2 10
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	on complete
		payment 3000 140
		dialog phrase "generic passenger dropoff payment"


mission "Frontier Emigration [1]"
	name "移民を<planet>へ"
	job
	repeat
	description "この <bunks> 人の乗客は、ついに<destination>で新しい人生を始められるだけのお金をためた。そして輸送してもらうためには <payment>支払ってもかまわないと思っている。"
	passengers 4 10 .8
	to offer
		random < 25
	source
		not government "Pirate"
		attributes "frontier"
		not planet "Shangri-La"
	destination
		distance 2 10
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	on complete
		payment 3000 140
		dialog phrase "generic passenger dropoff payment"


mission "Frontier Emigration [2]"
	name "移民を<planet>へ"
	job
	repeat
	description "この <bunks> 人の乗客は、ついに<destination>で新しい人生を始められるだけのお金をためた。そして輸送してもらうためには <payment>支払ってもかまわないと思っている。"
	passengers 6 10 .7
	to offer
		random < 20
	source
		not government "Pirate"
		attributes "frontier"
		not planet "Shangri-La"
	destination
		distance 2 10
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	on complete
		payment 3000 140
		dialog phrase "generic passenger dropoff payment"


mission "Disaster Relief"
	name "災害の救援を<planet>へ"
	job
	repeat
	description "災害が辺境の世界である<destination>の植民地でおきた。その惑星へ、<payment>で <date> までに <cargo>を配達せよ。"
	cargo "災害救援物資" 25 2 .05
	deadline
	to offer
		random < 10
	source
		government "Republic" "Free Worlds" "Syndicate" "Neutral" "Independent"
		not attributes "frontier"
	destination
		not government "Pirate"
		distance 2 10
		attributes "frontier"
		not planet "Shangri-La"
	on complete
		payment 10000 160
		dialog "あなたは<commodity>の積み荷を降ろし、<payment>の支払いをうける。<planet>の市民の一団があなたに礼を言い、別れを告げた。"


mission "Instruct Novice Pilot"
	name "初心者パイロットの教育"
	job
	repeat
	description "初心者パイロットが経験をつんだ船長からの教示を求めている。そして<stopovers>への護衛もだ。そのあとで、<origin>へ戻ると <payment>の報酬をうけることになる。"
	to offer
		random < 5
		"combat rating" > 100
	source
		government "Republic" "Free Worlds" "Neutral" "Independent"
		attributes "frontier" "dirt belt" "rim" "north" "south" "mining" "farming"
	stopover
		not government "Pirate"
		attributes "frontier"
		attributes "outfitter"
		attributes "spaceport"
		distance 3 7
	on stopover
		dialog "なめらかな着陸をしてから、あなたは講習生を宇宙港でもとくに荒れた区域に案内した。いっぱいのごみ、宿なしの浮浪者、そして照明が足りない路地を抜けていく。あなたはすべてを詳しく説明する。すりを避けること、バーのけんかにかかわらないこと、艤装屋のろくでもない取引を見ぬく方法。銀河でも評判のよくないところに数時間いて、あなたたちは二人とも<origin>へとても戻りたくなった。"
	on visit
		dialog "<planet>に戻ってきたが、最初に 「<npc>」 を<stopovers>まで案内するのを忘れていた !　さきにそちらへ向かったほうがいい。"
	on complete
		payment 75000
		dialog "講習生があなたに教示してくれたことで礼を言う。それに銀河でもさらに荒れた領域を案内して見せてくれたことでもだ。そしてあなたは <payment>の報酬を受けとった。"
	npc
		government "Pirate"
		personality nemesis waiting
		fleet "Small Northern Pirates"
		system
			distance 3 7
	npc accompany save
		government "Merchant"
		personality escort heroic vindictive
		fleet
			names "civilian"
			variant
				"Sparrow"
			variant
				"Star Barge"
			variant
				"Shuttle"
			variant
				"Heavy Shuttle"


mission "Small Pirate gambling"
	name "くだらない海賊の賭博"
	invisible
	minor
	to offer
		random < 3
		"reputation: Pirate" < 0
		"combat rating" < 200
		credits > 14357
	source
		attributes "dirt belt" "south" "rim" "pirate" "frontier"
	deadline 1
	on offer
		conversation
			"あなたが薄暗く照らされた宇宙港のバーで飲んでいると、真紅の革の服を着こんだ若者の集団が、暗い隅で賭博をしていることに気がついた。バーテンは用心して若者たちに目を向けている。若者のひとりが飲み物を持ちあげ、あなたに合図してきた。ゲームにあなたを誘っているのだ。"
			choice
				"	(ゲームに加わる)"
					goto gamble
				"	(無視していそいで離れる)"
					defer

			label gamble
			"	あなたはそのテーブルに歩いていった。近づいてよく吟味してみると、この若者の集団は海賊であることを強くにおわせている。だれひとりとして 20 歳以上には見えないし、全員が恐ろしげな入れ墨と危なそうな携帯武器を見せびらかしているのだ。カードで数回勝負をしてみると、いかさまをされているのがたっぷりとあきらかになった。そしてあなたに隠そうという努力はほとんどされていない。"
			branch "good luck" "bad luck"
				random < 30

			label "good luck"
			"action"
				payment 23974
			"	幸運なことに、あなたはどうにかして裏をかいてゲームに勝つことができた。クレジットチップのかなり大きな山とともにおひらきになる。若者たちはあまりうれしそうではなかったが、あなたがいそいで離れたときにもじゃましなかった。あなたは自分の幸運の星々に感謝する。海賊と直接顔をあわせたのに、25,000 クレジット近くもうけたうえに、無傷のままでいられたのだ。"
				accept

			label "bad luck"
			"	あなたはかねをしぼり取られはじめた。すでに 10,000 クレジット以上を失っている。"
			choice
				"(いかさまだと叫ぶ)"
					goto call
				"(なにも言わずにゲームをつづける)"
					goto lose

			label lose
			"action"
				payment -14357
			"	あなたは歯をかみしめて、勝負につづく勝負を負けつづけた。そしてついにゲームが終わる。海賊たちが満足げに 「勝ちとった」 15,000 クレジット近くになるチップを眺めるなかで、あなたは立ち去った。"
				decline

			label call
			"	あなたが露骨ないかさまに立ち向かうと、とくにたちの悪そうな男があなたに向かってどなる。「おれたちはただここでゲームをやってるだけなんだよ、なあ ?　でかい口は閉じといたほうがいいぞ。どうするのが自分のためになるのかわかるならな !　おれたちはやっかいなことに一瞬でできるんだ」"
			"	ちんぴらたちは脅かすようにあなたをじっと見つめ、銃に手をのばしはじめる。"
			choice
				"	(さきに撃つ !)"
					goto shoot
				"(賭け金をつかんで、逃げる !)"
					goto run
				"(かねを巻きあげさせてやる)"
					goto lose

			label shoot
			branch "shoot and die" "shoot and run"
				random < 30

			label "shoot and die"
			"	残念ながら、向こうのほうが速かったようです。無残な姿になったあなたの体が、湿った音を立てて床に崩れ落ちます。"
				die

			label "shoot and run"
			"action"
				payment 23974
			"	あなたは自分が非武装で船を離れることがないのに感謝した。あなたの手が腰にぶらさげたピストルに向かって飛ぶ。そして武器をぬき、あなたをちょうど脅していたあの海賊に発砲する。弾丸が男の胸の中心に穴をあけ、男は床に崩れおちた。ぎょっとした仲間たちは恐怖を感じて武器をうまくつかむことができなかったが、あなたは不意打ちでもうひとりをすばやく撃ちたおすと、逃げる潮時だと決心する。あなたはテーブルの上にあるクレジットの一部をつかみながら、逃げた !"
			"	格納庫へ駆け込み、大急ぎで離陸します。手早く戦利品を数えると、なんと25,000クレジット近く儲かっています！　大気圏を抜ける途中、残った二人の海賊がそれぞれの船から通信で罵詈雑言を浴びせてきます。すぐ後ろまで追ってきています。"
				launch

			label run
			branch "grab and die" "grab and run"
				random < 30

			label "grab and die"
			"	あなたは賭け金をつかんで、脱出をはかった !　ごろつきたちが叫び声をあげ、銃をぬいた。銃撃をよけながら、あなたはドアに向かって走る。そしてなかほどまで来るまえに、1 発の弾丸が的に当たった。あなたは痛みで床に倒れ、まわりには自分の血でできた池が広がっていくのが見える。あなたは必死に立ちあがろうとした。しかしいちばんの強面に見えた海賊があなたを地面に蹴りたおし、次の射撃で終わりにする。"
				die

			label "grab and run"
			"action"
				payment 23974
			"	あなたは賭け金をつかんで、脱出をはかった !　ごろつきたちが叫び声をあげ、銃をぬいた。ジグザグに動きながらドアに向かって走ると、弾丸があなたを追いぬいていき、壁からかけらが飛ぶ。あなたがうしろをちらっと見ると、ちょうどバーの店員がごろつきのひとりを巨大なショットガンでハンバーガーの肉に変えるところが見えた。残った 3 人はあなたを追いかけてくる。"
			"	格納庫へ駆け込み、大急ぎで離陸します。手早く戦利品を数えると、なんと25,000クレジット近く儲かっています！　大気圏を抜ける途中、港湾当局から連絡が入ります。海賊のうち二人は逮捕したものの、残りの二人は船にたどり着き、あなたを追っているとのことです。"
				launch

	to complete
		never

	npc
		personality launching heroic plunders vindictive nemesis
			confusion 20
		government "Pirate"
		fleet
			names "pirate"
			variant
				"Sparrow" 2
			variant
				"Wasp" 2
			variant
				"Wasp"
				"Sparrow"
